package com.juicygames.framework.action;

import android.graphics.Canvas;
import android.view.MotionEvent;

import com.juicygames.framework.GameAction;


public class TouchAction extends GameAction {
	
	private MotionEvent event;
	private float x;
	private float y;
	
	private static TouchAction instance = null;
	
	public static TouchAction getInstance(MotionEvent event) {
		if (instance == null) {
			instance = new TouchAction(event);
		} else {
			instance.setEvent(event);
			instance.setX(event.getX());
			instance.setY(event.getY());
		}
		return instance;
	}
	
	private TouchAction(MotionEvent event) {
		this.event = event;
		this.x = event.getX();
		this.y = event.getY();
	}
	
	public MotionEvent getEvent() {
		return event;
	}
	
	public float getX() {
		return x;
	}
	
	public float getY() {
		return y;
	}

	protected void setEvent(MotionEvent event) {
		this.event = event;
	}

	protected void setX(float x) {
		this.x = x;
	}

	protected void setY(float y) {
		this.y = y;
	}
	

}
